package com.example02;
import com.example02.User;

import static com.example02.OrderService.addorder;

public class Test {
    public static void main(String[] args) {
        User user = new User("小张",100,"东北林业大学");
        Product p1 = new Product("雪碧",3);
        Product p2 = new Product("小浣熊干脆面",1);
        Item i1 = new Item(p1,3);      Item i2 = new Item(p2,2);
        double endBalance = 0;
        Item[] i = {i1, i2};
        Order order = addorder(user, i);
        if(order != null) {
            endBalance = user.getBalance() - order.getCost();
            System.out.println(order.getCost());
            System.out.println(endBalance);
            System.out.println(user.getAddress());
        }
        else {
            System.out.println("用户余额不足");
        }
    }
}